<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <title>客户管理</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/weui/weui.min.css">
    <link rel="stylesheet" href="/static/weui/default.css"/>
</head>
<body>
<form class="page" action="/client/visit/create?client_id={{ client.id }}" method="post" id="form"
      onsubmit="onSubmit()">
    <div class="weui-form">
        <div class="weui-form__bd">
            {% csrf_token %}
            <div class="weui-form__text-area">
                <h2 class="weui-form__title">发起客户拜访</h2>
                <div class="weui-form__desc">
                    请输入客户名称已确认客户是否已在库中
                </div>
            </div>
            <div class="weui-form__control-area">
                <div class="weui-cells__group weui-cells__group_form">
                    <div class="weui-cells card">
                        <div class="weui-cell">
                            <div class="weui-cell__hd">客户</div>
                            <div class="weui-cell__ft">
                                {{ client.name }}
                            </div>
                        </div>
                    </div>
                    <!-- -->
                    <!-- 选择派单类型 -->
                    <div class="weui-cells weui-cells_radio card">
                        <div class="weui-cell">
                            <div class="weui-cell__bd">
                                1.选择派单类型
                            </div>
                        </div>
                        <label class="weui-cell weui-cell_active weui-check__label" for="kind1">
                            <div class="weui-cell__bd">日常拜访</div>
                            <div class="weui-cell__ft">
                                <input type="radio" name="kind" value="1" class="weui-check" id="kind1" required
                                       tips="请选择派单类型">
                                <span class="weui-icon-checked"></span>
                            </div>
                        </label>
                        <label class="weui-cell weui-cell_active weui-check__label" for="kind2">
                            <div class="weui-cell__bd">破冰拜访</div>
                            <div class="weui-cell__ft">
                                <input type="radio" name="kind" value="2" class="weui-check" id="kind2">
                                <span class="weui-icon-checked"></span>
                            </div>
                        </label>
                    </div>
                    <!-- 选择收单类型 -->
                    <div class="weui-cells weui-cells_radio card">
                        <div class="weui-cell">
                            <div class="weui-cell__bd">
                                2.选择收单类型
                            </div>
                        </div>
                        <label class="weui-cell weui-cell_active weui-check__label" for="receiver1">
                            <div class="weui-cell__bd">
                                本人收单
                            </div>
                            <div class="weui-cell__ft">
                                <input type="radio" name="receiver" value="1" class="weui-check" id="receiver1"
                                       required tips="请选择收单类型">
                                <span class="weui-icon-checked"></span>
                            </div>
                        </label>
                        <label class="weui-cell weui-cell_active weui-check__label" for="receiver2">
                            <div class="weui-cell__bd">
                                全部客户经理收单
                            </div>
                            <div class="weui-cell__ft">
                                <input type="radio" name="receiver" value="2" class="weui-check" id="receiver2">
                                <span class="weui-icon-checked"></span>
                            </div>
                        </label>
                    </div>
                </div>
            </div>
            <div class="weui-form__control-area">
                <div class="weui-form__opr-area">
                    <input role="button" class="weui-btn weui-btn_primary" type="submit"></input>
                </div>
            </div>
        </div>
        <div class="weui-form__ft">
            <div class="weui-form__extra-area">
                <div class="weui-footer">
                    <p class="weui-footer__text">Copyright © 2024 QHDUHU.COM.</p>
                </div>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript" src="/static/weui/jquery.min.js"></script>
<script type="text/javascript" src="/static/weui/weui.min.js"></script>
<script type="text/javascript" src="/static/weui/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    function onSubmit() {
        // weui.form.validate('#form', function(error){ console.log(error);}); // error: {dom:[Object], msg:[String]}
        weui.form.validate('#form', function (error) {
            if (!error) {
                var loading = weui.loading('提交中...');
                $('#form').submit();
                // setTimeout(function () {
                //     loading.hide();
                //     weui.toast('提交成功', 3000);
                // }, 1500);
            }
            // return true; // 当return true时，不会显示错误
        }, {
            regexp: {
                IDNUM: /(?:^\d{15}$)|(?:^\d{18}$)|^\d{17}[\dXx]$/,
                VCODE: /^.{4}$/
            }
        });
    }
</script>
</body>
</html>
